<template>
  <div>
      我是About --- {{ count }}  --- {{ num }}
      <button @click="add">+++</button>
       <button @click="addNum">num++</button>
      <!-- <button @click="addNum">num++</button> -->
  </div>
</template>

<script>
import { ref, toRefs } from 'vue'
import { useStore, mapMutations, mapState } from 'vuex'
export default {
    setup() {
        const count = ref(100)

        const store = useStore()
        const state = store.state
        console.log(mapMutations(["addNum"]))

        // const addNum = () => {
        //     store.commit('addNum')
        // }
        return {
            count,
            // addNum,
            ...toRefs(state),
            ...mapMutations(["addNum"])
        }
    }
}

// const count = ref(100)
// const add = () => {
//     count.value += 1
// }

</script>

<style>

</style>